//---------------------------------------------------------------------------
#ifndef CDBRGrpH
#define CDBRGrpH
//---------------------------------------------------------------------------
#include "CtrlDB.h"
#include <SysUtils.hpp>
#include <Controls.hpp>
#include <Classes.hpp>
#include <Forms.hpp>
#include <DBCtrls.hpp>
#include <ExtCtrls.hpp>
#include <StdCtrls.hpp>
//---------------------------------------------------------------------------
class PACKAGE_CTRLDB CDBRadioGroup : public TDBRadioGroup
{
private:
  bool       m_ReadOnly;
  bool       m_Enabled;
  AnsiString m_Reference;

  void __fastcall SetReadOnly    (bool value);
  void __fastcall SetEnabled     (bool value);

  void __fastcall CalculateVars(int &BtnPerCol, int &BtnWidth, int &BtnHeight, int &TopMargin);

protected:
  void __fastcall WMPaint(TWMPaint &Msg);
  BEGIN_MESSAGE_MAP
   MESSAGE_HANDLER(WM_PAINT, TWMPaint, WMPaint)
  END_MESSAGE_MAP(TDBRadioGroup)

public:
  __fastcall  CDBRadioGroup(TComponent* Owner);
__published:
  __property bool       Enabled      = { read=m_Enabled     , write=SetEnabled     , default=true  };
  __property bool       ReadOnly     = { read=m_ReadOnly    , write=SetReadOnly    , default=false };
  __property AnsiString Reference    = { read=m_Reference   , write=m_Reference};

  AnsiString __fastcall GetReference( void);
};
//---------------------------------------------------------------------------
#endif
